<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
  <script>
  var num1=123
  var num2=123
  console.log(num1===num2)//true
  //1.现象一：两个对象的比较
  var obj1 = {}
  var obj2 = {}
  console.log(obj1===obj2) //false
  //现象二：引用赋值
  var info = {
    name:"why",
    friend:{
      name:"kobe"
    }

  }
  var friend = info.friend
  friend.name="jams"
  console.log(info.friend.name) //jams
  //3.现象三：值传递
  // function foo(a) {
  //   a=200
  // }
  // var num=100
  // foo(num)
  // console.log(num)//100
  //现象四：引用传递
  //  function foo(a){
  //    a = {
  //      name : "why"
  //    }
  //  }
  //  var obj = {
  //    name:"obj"
  //  }
  //  foo(obj)
  //  console.log(obj)//打印的是obj的
  //5.现象五：引用传递，但是对传入的对象进行修改
  function foo(a) {
    a.name = "why"
  }
  var obj = {
    name: "obj"
  }
   foo(obj) 
     console.log(obj)//why
   
  </script>
</body>
</html>